﻿using System.Diagnostics.Contracts;
using System.Reactive.Concurrency;

namespace System.Reactive.Linq
{
	public static partial class Observable
	{
		public static IObservable<TSource> ElementAt<TSource>(this IObservable<TSource> source, int index)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(index >= 0, null, "index >= 0");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TSource> ElementAtOrDefault<TSource>(this IObservable<TSource> source, int index)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(index >= 0, null, "index >= 0");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TResult> Empty<TResult>()
		{
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TResult> Empty<TResult>(IScheduler scheduler)
		{
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<TSource> Expand<TSource>(this IObservable<TSource> source, Func<TSource, IObservable<TSource>> selector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(selector != null, null, "selector != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TSource> Expand<TSource>(this IObservable<TSource> source, Func<TSource, IObservable<TSource>> selector, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(selector != null, null, "selector != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}
	}
}